const defaultState = {
    number: 30,
    login_name: 'QxGH'
}

export default (state = defaultState, action) => {
    const newState = JSON.parse(JSON.stringify(state));
    switch (action.type) {
        case 'add_number':
            newState.number++;
            break;
        case 'sub_number':
            newState.number--;
            break;
        case 'set_number':
            newState.number = action.number;
            break;
        dafault:
            return newState;
    }
    return newState;
}